<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Contact extends Default_Controller{
	
	public function __construct(){
		parent::__construct();
		$this->_layout = "templates/default/layout";
		$this->load->model("Posts_Model");
		$thongbaomoi = $this->Posts_Model->getPostTop(1,6);
		$this->loadSidebar("thongbaomoi",$thongbaomoi);
		
		$tintucmoi = $this->Posts_Model->getPostTop(1,3);
		$this->loadSidebar("tintucmoi",$tintucmoi);
		$this->loadSidebar("fanpage");
	}
	public function Index(){
		$this->loadData("titlePage", "Liên hệ - Truyền hình cáp Đồng Tháp");
		$this->loadScript(base_url('js/jquery.validate.js'));
		$this->loadScript(base_url('js/localization/messages_vi.js'));
		$this->loadScript(base_url('js/jquery.order.js'));
		$this->loadBreadcrumb("Trang chủ",base_url()."default");
		$this->loadBreadcrumb("Liên hệ");
		$this->loadView('default/contact');
		if($this->input->post()){
				$this->load->model('Contacts_Model');
				$cusid = $this->Contacts_Model->insertContact();
				redirect('default/contact');
		}
	}
}